package com.gopay.cron.thread;

import com.gopay.cron.service.trans.ExportExcelService;

/**
 * Created by zhaoxubing on 2018/1/17.
 */
public class TransRecordThread implements Runnable {

    private ExportExcelService exportExcelService;
    private String beginDate;
    private String endDate;

    public TransRecordThread(ExportExcelService exportExcelService, String beginDate, String endDate) {
        this.exportExcelService = exportExcelService;
        this.beginDate = beginDate;
        this.endDate = endDate;
    }

    /**
     * When an object implementing interface <code>Runnable</code> is used
     * to create a thread, starting the thread causes the object's
     * <code>run</code> method to be called in that separately executing
     * thread.
     * <p>
     * The general contract of the method <code>run</code> is that it may
     * take any action whatsoever.
     *
     * @see Thread#run()
     */
    @Override
    public void run() {
        exportExcelService.exportExcel(beginDate,endDate);
    }
}
